@echo off
rem @name:    ExtractOR-MEMBER
rem @repo:    https://gitee.com/TangYuanMaster/ExtractOR
rem @author:  TangYuanMaster
rem @license: See the file 'LICENSE.txt'
echo ============ >> log.txt
mode con cols=60 lines=30
chcp 65001
setlocal enabledelayedexpansion
title ExtractOR-MEMBER_0.6
set n=0
cls
echo [INFO] ExtractOR-MEMBER_0.6
echo [INFO] Version 0.6
echo.
set /p choice=Please enter the number of draws[ Enter draws 2 lucky winners by default ]:
if "%choice%"=="" set choice=2
if "%choice%"==" " set choice=2
cls
echo [INFO] Extracting, please wait......
echo.
:abc
set /a n+=1
rem timeout /T 1 /NOBREAK
ping -n 2 127.0.0.1 > nul
set file=members.txt
set line_num=0
for /f %%i in (%file%) do set /a line_num+=1
set /a "line=!random!%%!line_num!"
set /a line+=1
set line_num=0
for /f "tokens=*" %%i in (%file%) do (
    set /a line_num+=1
    if !line_num!==!line! (
        echo %n% - %%i>> log.txt
        echo =========================%n%=========================
        echo      "Congratulations to %%i. Hope you could have a good try!"
        echo ===================================================
        echo.
    )
)
if %n%==%choice% echo [INFO] Enter to exit...... & pause > nul & exit
goto abc